home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_weap_mirror.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  95 lines

  1. # Jones 3D Cog Script
  2. #
  3. # weap_Mirror.cog
  4. #
  5. # This cog controls the freaking mirror in the Aetherium.
  6. #
  7. # [RandyT]
  8. #
  9. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15. message        startup
  16. message        selected
  17. message        deselected
  18. message        callback
  19.  
  20. model        mirrorHand=hand_in_mirror.3do    local
  21.  
  22. sound        pullSnd=gen_grenade_pull.wav    local
  23. sound        putSnd=gen_grenade_put.wav        local
  24.  
  25. thing        player                            local
  26.  
  27. int            handMesh                        local
  28. int            callNum                            local
  29. int            swapRef                            local
  30.  
  31. end
  32.  
  33. # ===================================================================
  34.  
  35. code
  36.  
  37. startup:
  38.  
  39.     player = GetLocalPlayerThing();
  40.     handMesh = GetMeshByName(player, "inrhand");
  41.  
  42.     return;
  43.  
  44. # -------------------------------------------------------------------
  45.  
  46. selected:
  47.  
  48.     SetAimWait(player, 0.0);
  49.     SetMountWait(player, 0.67);
  50.  
  51.     SetArmedMode(player, 2);
  52.     SetCurWeapon(player, 50);
  53.     SetThingFireOffset(player, '0.0 0.0 0.0'); 
  54.  
  55.     CaptureThing(player);
  56.     PlayMode(player, 66, 0);
  57.  
  58.     return;
  59.  
  60. # -------------------------------------------------------------------
  61.  
  62. deselected:
  63.  
  64.     SetMountWait(player, 0.67);
  65.     StopMode(player, 66, 0);
  66.  
  67.     CaptureThing(player);
  68.     PlayMode(player, 67, 0);
  69.  
  70.     SetArmedMode(player, 0);
  71.  
  72.     return;
  73.  
  74. # -------------------------------------------------------------------
  75.  
  76. callback:
  77.  
  78.     callNum = GetParam(1);
  79.     ReleaseThing(player);
  80.  
  81.     if (callNum == 28)
  82.     {
  83.         PlaySoundThing(pullSnd, player, 1, -1, -1, 0x880);
  84.         swapRef = SetThingMesh(player, handMesh, mirrorHand, 0);
  85.     }
  86.     else if (callNum == 29)
  87.     {
  88.         PlaySoundThing(putSnd, player, 1, -1, -1, 0x880);
  89.         RestoreThingMesh(player, swapRef);
  90.     }
  91.  
  92.     return;
  93.  
  94. end
  95.